import request from '@/config/axios'

// 教练请假 VO
export interface CoachLeaveVO {
  coachId: number // 教练ID
  leaveDate: string // 请假日期
  leaveType: number // 请假时段
  reason: string // 请假原因
}

// 教练请假 API
export const CoachLeaveApi = {
  // 查询教练请假分页
  getCoachLeavePage: async (params: any) => {
    return await request.get({ url: `/system/coach-leave/page`, params })
  },

  // 查询教练请假详情
  getCoachLeave: async (id: number) => {
    return await request.get({ url: `/system/coach-leave/get?id=` + id })
  },

  // 新增教练请假
  createCoachLeave: async (data: CoachLeaveVO) => {
    return await request.post({ url: `/system/coach-leave/create`, data })
  },

  // 修改教练请假
  updateCoachLeave: async (data: CoachLeaveVO) => {
    return await request.put({ url: `/system/coach-leave/update`, data })
  },

  // 删除教练请假
  deleteCoachLeave: async (id: number) => {
    return await request.delete({ url: `/system/coach-leave/delete?id=` + id })
  },

  // 导出教练请假 Excel
  exportCoachLeave: async (params) => {
    return await request.download({ url: `/system/coach-leave/export-excel`, params })
  },
}
